 function checkUserName() {
            var username = document.myform.username.value;
            var usernametab = document.getElementById('usernametab');
            if(/^\w{3,12}$/.test(username)){
                usernametab.innerHTML = '√';
                usernametab.style.color = '#0a0';
                return true;
            }else{
                usernametab.innerHTML = '×';
                usernametab.style.color = '#f00';
                return false;
            }
        }

function checkName() {
    var name = document.myform.name.value;
    var nametab = document.getElementById('nametab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]+$/.test(name)){
        nametab.innerHTML = '√';
        nametab.style.color = '#0a0';
        return true;
    }else{
        nametab.innerHTML = '×';
        nametab.style.color = '#f00';
        return false;
    }
}

// 表单提交验证
function checkForm() {
    return checkUserName() && checkName();
}